package com.achobeta.recruitment.service.interact;

import com.achobeta.recruitment.model.Attachment;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 马拉圈
 * Date: 2023-10-30
 * Time: 21:25
 */
public interface AttachmentService {

    /**
     * 保存文件
     * @param file
     * @param path
     */
    void loadFile(MultipartFile file, String path, String openid);


    /**
     * 记录一个附件与用户的映射
     * @param attachment 附件信息
     */
    void insertAttachment(Attachment attachment);

    /**
     * 删除附件
     */
    void deleteAttachment(Attachment attachment);

    /**
     * 根据openid查询附件列表
     * @param openid
     * @return
     */
    List<Attachment> selectByOpenId(String openid);


    /**
     * 根据id查询附件
     * @param id
     * @return
     */
    Attachment selectById(Integer id);

}
